<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="java.io.Reader"%>
<%@page import="com.ibatis.sqlmap.client.SqlMapClientBuilder"%>
<%@page import="java.io.IOException"%>
<%@page import="com.ibatis.sqlmap.client.SqlMapClient"%>
<%@page import="com.ibatis.common.resources.Resources"%>
<%@page import="java.util.*"%>
<%@page import="net.sf.json.JSONObject" %>
<%
SqlMapClient sqlMapClient = null;

Reader reader = Resources.getResourceAsReader("ibatis/demo/SqlMapConfig.xml");
sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(reader);
reader.close(); 

request.setCharacterEncoding("UTF-8");

List aaa = sqlMapClient.queryForList("selectAllAccounts");

Map<String, Object> map = new HashMap<String, Object>();     
map.put( "data", aaa );     
           
JSONObject jsonObjectMap = JSONObject.fromObject( map );     
out.println(jsonObjectMap);   
//JSONObject jsonObjectBean = JSONObject.fromObject(  );     
//System.out.println( "jsonObjectBean:" +  jsonObjectBean );   

%>